/*
 * 创建日期 2005-2-23
 *
 * 更改所生成文件模板为
 * 窗口 > 首选项 > Java > 代码生成 > 代码和注释
 */
package com.ctsi.commons.util.defImpl;



 

import com.ctsi.commons.util.cache.IutilCache;
import com.ctsi.commons.util.cache.UtilCache;

import java.util.Set;
/**
 * @author zhangjw
 *
 */
public class UtilCacheImpl<K, V> extends UtilCache<K, V> implements IutilCache<K, V>
{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8651262968151108295L;
	public UtilCacheImpl(String cacheName) {
		super(cacheName);
	}

	@Override
	public synchronized void removeByPrefix(String prefixkey)
	{
		
		Set<? extends K> keys = getCacheLineKeys();
		for (K key:keys){
			if (key instanceof String)
			{
				if (((String) key).startsWith(prefixkey))
					remove(key);

			}			
		}
	}
 



	
}
